/*
 # Mutual Reference
 @ Eugene.Complexa.Ares
 ! MIT License
 ~ show the implementation of mutual reference in C++, 1.	A simple description is in 'HW3.docx'
*/


#include <iostream>


using namespace std;

class B;            // N-C class "B" declaration

class A {
public:
	void foo(B b);    // prototype of foo, not substance 
	void goo()
    {
    }
};

class B {           // substance of class "B"
public:
	void zot(A a)
	{
 	    a.goo();
	}
	void zap()
	{
	}
};

void A::foo(B b)   // substance of foo, must be after the substance of class "A" and class "B"
{
	b.zap();
};

// Test Works
int main()
{
    A a = A();
    B b = B();
    cout << "Press any key" << endl;
    cin.get();
    return 0;
}
